<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [1,5,9,7,8,10,6,3,4];
        var mix = arr[0];
        for (let i = 1; i < arr.length; i++) {
            if(mix>arr[i]){
                mix = arr[i];
                
            }
        } 
        console.log(mix);
        
        var arr1 = [];
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] !== mix) {
                arr1.push(arr[i]);
            }
        }
        // console.log(arr1);
        var mix2 = arr1[0];
        for (let i = 1; i < arr1.length; i++) {
            if(mix2>arr[i]){
                mix2 = arr[i];
                
            }
        } 
        console.log(mix2);
    </script>
</head>
<body>
    
</body>
</html>